/**
 * @title: LockUtil
 * @projectName magic-api
 * @Description TODO
 * @Author
 * @Date 2021/9/10 16:13
 */
package com.sugon.magicapi.module;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.ssssssss.magicapi.config.MagicModule;

import java.util.concurrent.locks.ReentrantLock;

@Component
public class LockUtil implements MagicModule {
    @Autowired
    ReentrantLock lock;

    public void lock(){
        lock.lock();
    }

    public void unlock(){
        lock.unlock();
    }
    @Override
    public String getModuleName() {
        return "lock";
    }
}
